package com.xhdx.es.adau.test;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
/**
 * 接口关系：
 * ElasticsearchRepository --> ElasticsearchCrudRepository -->
 *     PagingAndSortingRepository --> CrudRepository --> Repository
 */
public interface UserRepository extends ElasticsearchRepository<UserEntity, String> {
	Page<UserEntity> findByName(String name, Pageable pageable);
    Page<UserEntity> findByAge(Integer age, Pageable pageable);
    //name模糊查询  and age
    List<UserEntity> findByNameAndAge(String name, Integer age);
    //name模糊查询  or age
    List<UserEntity> findByNameOrAge(String name, Integer age);
}
